home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
TP122792.ARJ
/
12-27-92.TPC
Wrap
Text File
|
1992-12-27
|
51KB
|
1,454 lines
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-21-92 08:06:00
From Dj Murdoch
To Mike Copeland
Subject Re: BP 7.0 IDE bug (Range checking)
MO> I have found a bug in the way the IDE handles compiler flags.
MO>Consider the following peice of code:
MO>{$A-,B-,D-,E-,F-,G-,I-,L-,N-,O-,P-,Q-,R-,S-,T-,V-,X-,Y-}
MO> ^^^^^
MO> Note Range checking and Overflow
MO> checking are off
MO>{$M 65520,0,655360}
MO>type
MO> PArrayPtr = ^PseudoArray;
MO> PseudoArray = Array[0..0] of byte;
MO>var
MO> PA : PArrayPtr;
MO> PA^[2] := 33;
MO> ^ Does not compile, gives "Constant out of
MC> range" on attempt to
MO> compile this:
MO>However, change the above code to this:
MO>{$A-,B-,D-,E-,F-,G-,I-,L-,N-,O-,P-,Q-,R-,S-,T-,V-,X-,Y-}
MO>{$M 65520,0,655360}
MO>type
MO> PArrayPtr = ^PseudoArray;
MO> PseudoArray = Array[0..0] of byte;
MC> Thanks, Mark! This is a good one to know about, since
MC> (1) I just got BP7.0, and (2) I use this technique in my code...
MC> ('Course, I haven't been able to free up 28meg on my HD
MC> yet, so I haven't installed the darn thing... 8<}})
Don't worry about it - the behaviour is the same as in TP 5.5 & 6.0. Because
the declaration doesn't include the element 2, it's an error to reference it.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/23 10:43:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 16:27:00
From Dj Murdoch
To Wayne Boyd
Subject Re: Stack overflow
WB> Why not just avoid recursion completely? You don't NEED to
WB> recurse you know. For example...
I don't see how you'd do a recursive directory search by this means. It's
easy to simulate recursion with loops, but you really do need a stack somewhere.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:07:50
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 17:23:00
From Dj Murdoch
To Joe Jared
Subject Re: HUFFMAN.PAS
JJ> Are you just using one node array? If so, that
JJ> explains everything. The huffman compression I'm using
JJ> uses a combination of parent and son, and packs them based
JJ> on which match comes up first. If ANY portion of first
JJ> match on either array is missed, the result will be faster
JJ> but less than ideal compression. A problem parent or a
JJ> problem child comes to mind if you are using both.
I think there are lots of variations on Huffman compression. We've obviously
chosen different ones.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:07:50
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 17:26:00
From Dj Murdoch
To Wayne Boyd
Subject Re: 7.0
WB> Now, the question I have, though, is whether or not the
WB> latest version has a compiler switch for OS/2?
Nope! TP 7 just produces real mode DOS apps. BP 7 produces those, plus DOS
16 bit protected mode programs, plus Windows programs. BP 7 includes essentiall
all of TPW 1.5 (with a newer compiler) plus TP 7.
There are language changes, but not huge ones. There are new optimizations,
but some of them may be ahead of their time: Novell netware has bugs that
mess up calculations in some BP programs run at full speed. There's an easy
way to turn off the 386 register usage (just set Test8086 to 0 at the start
of your program), but it's a real shame to have to do that.
The IDEs are a lot lot the TP 6 IDE, but with the rough edges removed. They're
really nice.
A number of bugs from my TP6 bug list have been fixed; I haven't tallied them
all yet.
A number of new bugs have been introduced, too. I think you're generally
ahead in the bug department again, especially if you keep up on the bug fixes
that have been posted here.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:07:51
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 17:35:00
From Dj Murdoch
To Jussi Vainionp{{
Subject Re: GRAPHICS mouse in TEXT mo
DP> > It is called PASMOU.ZIP. It is available on CRS and
DP>If you can't find it, reply back to me and I will send it DP>in an UUencoded form.
JV> Please send it!!!
JV> * Origin: * BCG-Box, Turku, Finland * (2:222/151)
If you do send it, please do it by netmail! Posting UUE material here is
not allowed.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:07:51
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 20:52:00
From Dj Murdoch
To Andrew J. Mead
Subject Re: BP 7 difference
> JM> RandSeed := 123;
> JM> for i := 1 to 8 do writeln( random( 1000));
> JM> TP 5.5: 343 282 986 996 781 855 343 32
> JM> BP 7.0: 859 80 869 854 317 257 20 46
AJ> I haven't verified this, but I have verified that TP7
AJ> (as opposed to BP7) real mode apps follow the same random
AJ> sequence as TP50, TP55, and TP60.
That's interesting! Were you using exactly the sequence above, or different
code? If the same code, that would indicate that the RTL in TP7 is different
from BP7.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:07:51
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 06:15:00
From Trevor Carlsen
To Keith Dombrowski
Subject Re: SB
KD> What, by your/fido's description is a non-crippled
KD> reader/editor? How many lines, etc, must it support?
FidoNet does not have a defined length limit for messages. Therefore any
mailer that arbitarily imposes a defined limit is theoretically non-compliant.
In practice the limit is available disk space.
Readers and editors are a different situation. As they are not directly involve
in the network, they do no affect "pass-through" mail. Therefore they only
affect mail at the node where they are being used. The sysop and/or user then
needs to make a decision as to whether or not they are useful if they have
arbitary limits on message size. I personally would not use a reader/editor
if it could not handle the complete text of a message that would occupy all
available RAM.
This Pascal conference has a 16K limit on message size.
Moderator
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:08:19
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 04:11:00
From Mark Ouellet
To Dj Murdoch
Subject Re: borland pascal 7.0
On 16-Dec-92, you, Dj Murdoch, of 1:249/99.5 wrote...
DM> I don't think TD386.EXE will work with QEMM no matter what you do, but
DM> unless they've changed something, TD386.SYS will. You load it to get
DM> access to the hardware debugging features of the 386 chip. They should
DM> be available in TD and in TD286.
Thanks for the tip Dj.
I haven't tried it yet but maybe the DPMI add-on for Qemm can make a
difference. I doubt it though. In any case i'm glad to know about the
.SYS still being usefull with TD286!!!
Best regards,
Mark Ouellet.
--- Squish v1.01
* Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:08:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 04:13:00
From Mark Ouellet
To Dj Murdoch
Subject Re: Pointers
On 16-Dec-92, you, Dj Murdoch, of 1:249/99.5 wrote...
DM> Change this declaration to Array[0..65520] of byte, and your trouble
DM> should go away.
Yes Dj,
all the replies I got point in that direction. I still think turning
Range-Checking off should also turn off warnings from the compiler.
Either you give the user full control or you don't.
Having to declare an array large enough is a minor setback but a
setback non-the-less.
Best regards,
Mark Ouellet.
--- Squish v1.01
* Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:08:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 04:16:00
From Mark Ouellet
To Rand Nowell
Subject Re: Strange Happenings!
On 16-Dec-92, you, Rand Nowell, of 1:161/710.0 wrote...
RN> Hi Mark, please do! And let me know what the results are, I have used
RN> this procedure before and had no problems....(lucky??)
Ok Rand,
I'll try it out some time. Haven't had time yet!! I'll let you know
how it turns out. If your extra "0" was caused by something else then it
could be a simple trick to eliminate directories from the list.
Best regards,
Mark Ouellet.
--- Squish v1.01
* Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:08:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 04:37:00
From Mark Ouellet
To Ken Burrows
Subject Re: Pointers
On 09-Dec-92, you, Ken Burrows, of 1:249/201.21 wrote...
KB> Element [2] IS out of range of an array[0..0], use the array[0..$FFFE]
KB> and it will be in range. It cost nothing to type a large structure, and
KB> use a SLen variable to keep track of how many elements are actually
KB> created on the heap.
Yes Ken,
but as I told Duncan, I thought it would only be logic to allow me
to compile it. setting Range-checking off should also disable compiler
warnings!!
Best regards,
Mark Ouellet.
--- Squish v1.01
* Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:08:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 04:48:00
From Mark Ouellet
To Michel Dussault
Subject Re: Windows API Call
On 18-Dec-92, you, Michel Dussault, of 1:240/518.0 wrote...
MD> Does somebody know why most of the calls to Windows API are pascal call
MD> type ????
Michel,
Maybe to simplify MicroSoft's problems:
C and C++ can be told to use Pascal convention when passing
parameters
Pascal can't be told to use C convention.
So if you intend to compile assembler, Pascal or C routines useable by
both you had better make it Pascal convention. Since it's the only
standard they both can use.
Best regards,
Mark Ouellet.
--- Squish v1.01
* Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:08:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 04:54:00
From Mark Ouellet
To Tom Lawrence
Subject Re: Speed wanted !
On 16-Dec-92, you, Tom Lawrence, of 1:2605/606.0 wrote...
TL> Well, not quite. Borland's move uses movsb, and for some reason
TL> (probably a good one I'm not aware of), they point ds:si to the source
TL> variable, advance ds:si to the END of the source, then copy backwards
TL> (via std instead of cld). Anyway, here's a replacement MOVE procedure
TL> that's twice as fast, since it DOES use MOVSW... and also handles
TL> moving an odd-number of bytes, as well:
TL>
TL> Procedure FastMove(Var Source,Dest;Count:Word); Assembler;
TL> Asm
TL> push ds
TL> lds si,SOURCE
TL> les di,DEST
TL> mov cx,[COUNT]
TL> shr cx,1
TL> pushf
TL> cld
TL> rep movsw
TL> popf
TL> jnc @E
TL> movsb
TL> @E: pop ds
TL> End;
TL>
Tom,
Borlands move procedure will also handle moves with overlaping
memory regions like Moving A[2] to A[1] for 256 elements. Maybe that is
why you noticed the reverse move in the code you examined. Not sure
either if MOVE is an actual routine in the system unit or if it's
inserted into the compiled program like inline or like a macro.
BTW, your routine could be even faster on 386 CPUs and up if you
checked for them and used a 32bit move. I guess the algorithm would be
similar. First doing 32bit moves and then checking if the remaining
number of bytes to move warrants a 16 bit move. Do a 16 bit move if it
does. The do an 8 bit move if there is still data to be moved.
Best regards,
Mark Ouellet.
--- Squish v1.01
* Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
* Tossed by SFToss/286 v1.02a on 92/12/24 08:08:47
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 07:59:00
From Dj Murdoch
To Howard Hamlin
Subject Re: BP 7.0
HH> The problem has nothing to do with Qemm. I'm using BP7 on
HH> a 286-10 ( don't laugh...it's all I've got ) and I don't
HH> use any memory managers. The state of the shift key
HH> becomes random when I run BP.EXE (TURBO.EXE is fine). I'm
HH> waiting until the folks at Borland are back from vacation
HH> so I can find out what's going on with this bug. By the
HH> way...if you compile TVDEMO in protected mode the same
HH> problem occurs so it seems to be a problem with Borland's
HH> DPMI but I'm not sure.
On a 286, changes from protected mode to real mode are very slow. It's possible
that BP is switching back and forth while getting keys, and losing interrupts
during the transition. I don't know if there's going to be any solution for
this one.
One thing I don't think you've mentioned: have you got any TSR's or device
drivers loaded beyond the bare minimum? Make sure it happens on a clean system,
or Borland will just tell you that the other software is causing the trouble
(and it may well be true).
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:56:43
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 08:04:00
From Dj Murdoch
To Andres Cvitkovich
Subject Re: Multiple overlays or DLL's?
AC> IMHO this could be done using procedure/function
AC> variables, where the 8088/86 routines are in one overlaid
AC> Unit, and the 286/386 (386?) are in the other. A small
AC> test routine at program start could initialize those
AC> proc/func vars with the appropriate values for the
AC> processor installed. Then, only one unit should be used at
AC> runtime, saving precious memory (though both are in one
AC> a-little- bit- bigger OVR file).
Yes, you're right. I thought the question was about doing it with separate
.OVR files. Another way to do it with just one .OVR file is to put the procedur
s & functions into an object; have a function at the beginning initialize
the object according to the processor type.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:56:43
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 08:09:00
From Dj Murdoch
To Mike Copeland
Subject Re: ..
DM>Here's a problem that lots of people would like to see
MC> a nice solution
DM>to: a source code mangler.
MC> ^^^^^^^^^^^^^^^^^^^^^
MC> Dj, I must be really naive: WHY? What's the use
MC> of/purpose for such a program? I just can't imagine
MC> anything positive or good from such an exercise in programming... 8<{{
MC> "lots of people"??? WHO?
MC> I'm truly puzzled...
This is for people who want to release units but don't want to give away their
secrets. If they want to support all .TPU versions, they've got to release
8 or 9 different .TPU files now, but a single mangled source may be just as
cryptic and yet recompile in any TP version.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:56:43
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-22-92 23:15:00
From Trevor Carlsen
To Joy Mukherjee
Subject crippled readers/mailers
TC>> this regard and many moderators are now taking a stand on
TC>> this.
JM> Many moderators can do whatever, but the software dictates
JM> what everyone else can do.
That is true of course but if users refused to use inferior software, authors
would very quickly get their act together.
Personally, I cannot understand why anybody would want to use software that
will mean they miss parts of important messages because it cannot read all
of a FidoNet legal message.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:33
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 14:02:00
From Trevor Carlsen
To Steve Connet
Subject Pointers
> You'll need to put another pointer in the record...something like
>Type CurrentPtr = ^EachRecord;
> EachRecord = Record
> Dummy : Integer;
> NextRecord: CurrentPtr; { this is so you can go forward }
> PrevRecord: CurrentPtr; { this will let you go backward }
> End;
> Going backward is just like going forward, only the other
> direction. Same logic though...
SC> So let's see, to go forward I would say (assuming Vars are defined):
SC> MyPointer := MyPointer^.NextRecord;
SC> And to go backward, would it be:
SC> MyPointer := MyPointer^.PrevRecord;
SC> But I am confused. How does it know when to go backward or
SC> forward? Both assignment statements are the same. Alas my
SC> frustration has caused me to tell you exactly what I'm
SC> trying to do.
Which will have the effect of allowing us to help now that we know exactly
what you are trying to do. Firstly, I do not agree that a linked list is
what you should be using. An array of pointers is a far better way to do
this but I will show how to use the linked list method as that is an ideal
way to understand how pointers work.
In any linked list using the above record structure as an example, the PrevRecor
and NextRecord pointers have undefined values until your program defines
them. Let us start from scratch and create a linked list by reading a text
file and as each string is read from that file we will place it into the list.
Here is a working and extensively commented example.
SC> I have a list of names and index number of arbitrary length
SC> on disk. I want to read them all in (or as much as memory
SC> will allow). They are to be displayed on the screen.
SC> Pressing the up arrow would scroll through the list in
SC> reverse, and pressing the down arrow would scroll through
SC> the list going forward.
program LinkedListDemo;
uses crt;
type
{ First create the linked list structure }
linePtr = ^LineRec;
LineRec = record
LineStr : string[80];
prev,
next : linePtr;
end;
var
rootLine, { a pointer to the first record }
currentLine, { the current record }
endLine : linePtr;{ the last record in the list }
f : text;
ch : char;
procedure ReadTextLine;
{ creates space in memory for a new line and then reads the string }
{ from the file and places it into that newly created space. }
var
tempLine : linePtr;
begin
{ Create the space for the new record and place this space }
{ address into the currentLine^.next pointer. First though we }
{ must check if there is enough memory for the record. }
if MaxAvail >= sizeof(LineRec) then { there is enough memory } begin
new(tempLine);
if currentLine <> nil then
currentLine^.next := tempLine;
{ The space has now been allocated so make currentLine point to}
{ the new space and check if it is the root entry by checking }
{ whether rootLine is nil or has a value and that its next }
{ pointer is also initialised. }
currentLine := tempLine;
if rootLine = nil then
rootLine := currentLine
else if rootLine^.next = nil then
rootLine^.next := currentLine;
{ Initialise the prev and next pointers in currentLine }
currentLine^.prev := EndLine;
{ there is currently no next record so define the next pointer }
{ as nil to indicate that this record is the last record in the}
{ list. Also update the EndLine pointer; }
currentLine^.next := nil;
EndLine := currentLine;
{ The housekeeping complete, we can now read the line }
readln(f,currentLine^.LineStr);
end else { there was not enough memory - remember? :-) } begin
writeln('Out of memory... aborting');
halt;
end;
end; { ReadTextLine }
procedure DisplayForward(startLine: linePtr; number: byte);
{ Display number lines. Normally this would be the size of your screen }
var
x : byte;
line : linePtr;
begin
line := startLine;
x := 0;
{ Create the loop that will display number lines }
while (line <> nil) and (x < number) do begin
inc(x);
writeln(line^.LineStr);
currentLine := line;
line := line^.next; { goto the next record in the list }
end; { while }
end; { DisplayForward }
procedure DisplayBackward(startLine : linePtr; number: byte);
var
x : byte;
line : linePtr;
begin
line := startLine;
x := 0;
with line^ do begin
while (prev <> nil) and (x < number) do { walk back through the list }
inc(x);
{ We have walked back and found where to start displaying from so }
DisplayForward(line,number);
end;
end;
begin { main }
assign(f,'p:\prog\linklist.pas');
reset(f);
{ The first thing we MUST do is initialise the rootLine and endLine }
{ pointers }
EndLine :=nil; rootLine := nil; currentLine := nil;
while not eof(f) do { read the file and create the linked list }
ReadTextLine;
close(f);
Clrscr;
currentLine := rootLine;
repeat
DisplayForward(currentLine,22);
ch := ReadKey;
until currentLine = endLine;
{ To reclaim all the memory it is the simple matter of walking the list }
{ and disposing each record as you go. eg. }
repeat
currentLine := rootLine^.next;
dispose(rootLine);
rootLine := currentLine;
until currentLine = nil;
end.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:33
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 18:16:00
From Trevor Carlsen
To Andres Cvitkovich
Subject Findfirst - SearchRec Name
AC> Sorry for intercepting - but isn't it possible to fill the
AC> rest of "s" directly (since it's passed by value) or is
AC> "TempStr" really needed? And, what is "ch" needed for?
AC> function FillStr (size: byte; s: string): string;
AC> begin
AC> if length (s) < size then begin
AC> FillChar (s[length(s)+1], size-length(s), 32);
AC> s[0] := char(size);
AC> end;
AC> FillStr := s
AC> end;
AC> You could also write the "s[0] := ..." outside the if
AC> statement to shorten the string if it's too long.
AC> But - if I missed something, tell me.
All your points are correct. I entered that on-the-fly so I guess I'll claim
that as a reason for its sloppiness! The ch was intended to allow any character
to be used as a padder - then I didn't use it :-(.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:33
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 09:47:00
From Trevor Carlsen
To Terry Grant
Subject POS
TG> Can someone give me a little more detail on how to use POS,
TG> It works fine during PLAIN ASCII searches, But not when I am
TG> looking for Multiple Words like Connect 2400 ? ( Worked fine
TG> for 2400 though ? )...
You make it next to impossible for anybody to help you by choosing NOT to
show the faulty code.
Therefore the only advice we can give is to go back to basics and check out
the correct syntax in your manual.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 17:32:00
From Trevor Carlsen
To Aaron Marasco
Subject BBS
AM> It would be possible to create a DONE procedure of some sort
AM> that closes files, memory, etc. ie:
AM> If (Not Carrier) and (Not Local) then
AM> Begin
AM> Done;
AM> Halt(200); {Where 200 is a carrier drop - you can make ansi
AM> message to them on their next call. . .}
AM> End;
Better to make Done an exit procedure and then you do not need to call it
explicitly. It also has the added advantage of doing your closing down housekeep
ng regardless of where the program is when it terminates. So -
var
OldExitProc : pointer;
procedure Done; far;
begin
ExitProc := OldExitProc;
{ Do your closing down housekeeping here }
end;
Then in your initialisation routine -
OldExitProc := ExitProc;
ExitProc := @Done;
Then any halt automatically executes Done.
Simpler, cleaner, more reliable and more efficient.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 09:58:00
From Trevor Carlsen
To Jason Chancellor
Subject backspace
JC> I (want)... a function that would take the last character
JC> off a string. Like a backspace would do.
if byte(st[0]) > 0 then
dec(st[0]);
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 11:07:00
From Trevor Carlsen
To Mike Copeland
Subject Re: ..
DM>to: a source code mangler.
MC> ^^^^^^^^^^^^^^^^^^^^^
MC> Dj, I must be really naive: WHY? What's the use of/purpose
MC> for such a program? I just can't imagine anything positive
MC> or good from such an exercise in programming... 8<{{
A good mangler would make authors much more likely to distribute source code
with their TPUs, thus enabling code libraries to be used across versions of TP.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 10:09:00
From Trevor Carlsen
To Andres Cvitkovich
Subject Fast Direct screen write
AC> DirectVideo is part of the Crt Unit. Setting to False causes
AC> TP to write to stdout via DOS-calls. You could also use the
AC> file variable Output (=stdout), so you don't have to alter
AC> DirectVideo and can use both.
AC> Sample: Writeln (Output, 'This goes to stdout');
The above information, or some variant of it, has to be top of the hit parade
in this echo for the most frequently given misinformation.
DirectVideo := false does NOT cause screen output to be done by DOS calls.
It means that the crt unit uses BIOS to do its work. In fact stdout does
not use DOS at all if the crt unit is in use unless you direct it to do so.
(See page 162 in the BP7 Language guide or page 199 in the TP6 Programmer's
Guide.)
Your sample line, whilst certainly using stdout, does not necessarily use
dos. This is because the crt unit hijacks stdout itself.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 17:40:00
From Trevor Carlsen
To All
Subject New moderator
As of the 31st January 1993 I shall be resigning as Moderator of this echo.
Unfortunately the demands of my business interests mean that I cannot afford
even the simple extra half hour required per day over and above normal echo
reading.
Accordingly, I have approached Duncan Murdoch (Dj Murdoch) and asked him if
he is willing to take over the responsibility. He has agreed to do so and
I will therefore accept netmail messages until the 15th January should anybody
have any objections to this. (Rule 15 does not require this but in order to
listen to and consider any objections anybody may have, I believe this to
be a reasonable thing to do.)
Duncan is a well respected, long term contributor to the echo who has a vast
wealth of knowledge about Turbo Pascal. I have valued his netmailed messages
to me on the odd occasions when my patience has been stretched to the limit
by the occasional idiots no public echo can avoid.
I will remain a contributor to and reader of the echo, albeit in a reduced
way. The contest I started in September will remain current and I may even
(with Duncan's permission of course) run others.
Finally my wife Georgie and I wish all of you a very Merry Xmas and a Happy,
prosperous and healthy new year.
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 20:06:00
From Trevor Carlsen
To Darcy Parker
Subject GRAPHICS mouse in TEXT mo
DP> If you can't find it, reply back to me and I will send it
DP> in an UUencoded form.
You are welcome to do so on YOUR OWN DOLLAR. That means by netmail only.
This echo is not for the private exchange of binary code so UUEncoded files
are not permitted here.
Moderator
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 20:14:00
From Trevor Carlsen
To John Reid
Subject Re: BP 7 difference
JR> ... It even effects TeeCee's latest
JR> contest, doen't it?
Not really. The file has been created already so the sorting of it does not
require any reference to the random function. For those creating the file
for their own testing - well yes, they would be testing on a different file.
However I fail to see how that could affect their algorithms or design.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:34
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 20:01:00
From Dj Murdoch
To Mark Ouellet
Subject Re: Windows API Call
MO> C and C++ can be told to use Pascal convention when passing
MO> parameters
MO> Pascal can't be told to use C convention.
MO> So if you intend to compile assembler, Pascal or C routines useable by
MO> both you had better make it Pascal convention. Since it's the only
MO> standard they both can use.
Why couldn't Pascal use the C convention?
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:35
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 00:34:00
From Dj Murdoch
To All
Subject TP 6 bug list update
I'm planning to produce one final update to my TP 6 bug list (the current version
is available on PDN sites as tp6bugs6.zip). If anyone knows of any bugs that
aren't in that list or the list below, please let me know as soon as possible.
Demonstration code is nearly essential; I try to confirm any bugs that I put
in my list.
The FLDLN2 instruction (which is valid on an 8087) triggers error 159, "286/287
instructions are not enabled" when compiled in the $N+,G- mode. (Fixed in
BP 7.)
The string formatting routines get the 19th digit wrong on very large Comp
numbers. (Not fixed in BP 7.)
The TDSTRIP utility which comes with the professional version of TP damages
the .EXE header: the min extra paragraphs field is set to 0. (See STRIPPED.ZIP
in TP6BUGSn.ZIP for a damage detector). (Fixed in BP 7.)
Actual heap allocation can be 511 bytes more than the maximum specified in
the $M directive. (Not fixed in BP 7.)
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 00:36:00
From Dj Murdoch
To All
Subject BP 7 bug list
I've decided to try to continue my unofficial bug list with the DOS parts of
BP 7. I've checked a lot of the TP 6 bugs in the new version; besides the
leftovers, I've come up with 11 new ones. If you know of any others than
the ones below, please let me know. In a few days or so, I'll put together
a full list that includes all fixes and patches, and send it out on PDN.
28. Coprocessor errors are reported with the address normalized, but the IDE
can't find source lines with errors specified that way. Use the command line
compilers with /F ssss:oooo to find them.
29. On a 386, a longint shift of 16 bits or more is unreliable. (A fix is
available in NEWSHR.FIX.)
30. On a 386, interrupt routines must save the extended registers EAX through
to EDX or risk corrupting longint calculations.
31. On a 386, longint calculations are unreliable in environments (like certain
Novell netware versions) which don't preserve the extended registers. (The
only "fix" to BP is to turn off 386 operations by executing Test8086=0 at
the start of your program, if you can't get the buggy netware fixed.)
32. The DisposeNode procedure in the Outline unit neglects to dispose of the
Text string. (A fix is available in OUTLINE.FIX.)
33. Overflow checking $Q+ sometimes misses overflows in operations on bytes.
34. The file dialog in STDDLG.PAS messes up directory changes. (A fix is
available in FILEDIAL.FIX.)
35. Spurious compiler arithmetic overflow errors are generated in constant
expressions containing products of negative numbers with zero.
36. If a running program changes a file that's currently loaded in the IDE,
when you exit you'll lose the IDE version no matter how you answer the dialog
about which version to keep.
37. The expression "Word(hi(wordvar))" doesn't zero-extend the high byte of
wordvar to give a word, it gives the word from memory starting at the location
of the high byte of wordvar, i.e. the high byte plus the low byte of the next
variable.
38. With the extended syntax $X+, asciiz character arrays that are fields
in records passed as const parameters aren't handled properly by Writeln.
(This bug report clearly needs some work!)
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/25 15:57:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 00:00:00
From Terry Hughes
To Jud Mccranie
Subject Re: B-tree problem
JM>Later: I think I found the problem. The data and program are on
JM>drive C of the server. The network drive is F. The guy here told
JM>me that running on C or on F on the server was the same thing. But
JM>it seems that when the program running on the server is on C it
JM>doesn't know that it is really on the network. In that case, it
JM>and a W.S. may have the same # (it happened again), but it only
JM>happened when the program on the server was going to drive C instead
JM>of the network drive (which may have other bad consequences).
The workstation number (really, internal dialog number) is now
associated with a fileblock's dialog file. If two workstations are using
different dialog files (as sounds like is happening with your C/F drive
mapping) then it is possible for them to get identical workstation
numbers. However, if two programs are using different dialog files then
nothing is going to work right (workstation numbers or locking in
general).
Here's another thought...the unique workstation numbers are achieved by
locking portions of the dialog file. Perhaps you really are working with
the same dialog file (referenced by C: or F:) but the network shell
doesn't recognize it as such (due to the C/F mapping) and is making
separate entries in its lock table. As with the first scenario, this
will cause many more problems then just duplicate workstation numbers.
JM>One more thing - it assigns a number 1 .. 50 (default) to each
JM>workstation's fileblock. Does that limit you to 50 workstation/FB
JM>combinations, or can each FB have 50 workstations on it? That is,
JM>with 7 file blocks open at once, is that going to limit it to
JM>50/7 = 7 workstations?
The limit is 50 workstations (controlled by MaxNrOfWorkstations) per
fileblock.
Here's a thumbnail sketch of how workstation numbers work now that might
help you understand some of these issues better: Each fileblock's dialog
file now maintains the "list" of workstation numbers. BTOpenFileBlock
gets a workstation number by attempting to lock a single byte of the
dialog file representing workstation one. If that byte is already locked
it means some other workstation has already been assigned the number
one. So, BTOpenFileBlock tries to lock the next byte -- and so on. If it
eventually succeeds then the byte it locked is the workstation number;
if all 50 bytes are already locked then BTOpenFileBlock fails.
-Terry
___
X QMPro 1.0 41-2187 X TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss/286 v1.02a on 92/12/26 09:47:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-23-92 00:00:00
From Terry Hughes
To Luis Martin
Subject Object Professional 1.1
LM>Does OPRO have an unlimited-size-file editor ?
No. OPRO has several editors but all are limited to 64K. However, one of
our tech support guys wrote a very similar editor (in form and
capabilities) that is limited only by available heap space and that
editor (OPBIGED.LZH, I think) is available on our BBS. I believe he
later used the VIRTMEM unit from Analyst that I mentioned to make that a
true virtual editor but I don't think we've made that generally
available yet.
LM>From your words it seems OPRO lacks a virtual memory
LM>manager, but Turbo Analyst has it. (Source included?)
Correct. OPRO does not have a virtual memory manager; Turbo Analyst does
and it includes complete source code.
LM>First of all, I don't know if OPRO would let me use
LM>unlimited size TCollections or something similar to
LM>unlimited TCollections, besides the unlimited size editor.
OPRO doesn't do anything to extend TCollections or any other component
of TV. OPRO has a wide variety of container classes (lists, stacks,
queues and large arrays) but none of these are unlimited. The large
array facility probably comes closest, being able to virtualize arrays
to EMS, XMS or disk (up to 16 megs).
LM>I supose the change form TV to OPRO is less troublesome
LM>than switching from not-event-programming to TV, but how
LM>many hours or days do you think would it cost to make the
LM>transition ?
That question is too subjective and has too many variables for me to
give you meaningful answer. Popular opinion seems to be that OPRO is
easier to learn than TV. And OPRO definitely provides more functionality
"out of the box." However, if you've already committed to and mastered
TV then these points probably don't matter much.
LM>From the comments I've read most people rate OPRO very
LM>high, and I think it must be very good stuff, but the lack
LM>of virtual memory, in my case, would make its purchasing
LM>very hard to justify.
OPRO has a couple of thousand functions that can probably save you lots
of programming time and effort, but a virtual memory manager isn't one
of them.
LM>I don't need Turbo Analyst, but I'd be glad to hear any
LM>sugestions you'd have for me.
I'm not sure what else to suggest. You say you need a virtual memory
manager, which Analyst has, but you don't need Analyst?
I guess you could go with one of the commercially available virtual
memory managers. Last time I checked in the Programmer's Connection
catalog there were at least two virtual memory products that worked with
Turbo Pascal but both were in the $200 to $300 (discounted) range.
You might want to try searching for a public domain or shareware unit. I
don't ever recall seeing one but I never really looked.
-Terry
___
X QMPro 1.0 41-2187 X TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss/286 v1.02a on 92/12/26 09:47:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 22:15:00
From Dj Murdoch
To Chris Priede
Subject Re: exe's
DM> When COMMAND.COM runs your program, it puts the full DM> pathname in;
that's why you usually see it there.
CP> That is correct, however, any responsible program should do the
CP> same as many other programs rely on it.
It turns out I was wrong. COMMAND.COM *does not* put the full pathname there;
it puts the path as it appears in the PATH environment variable. If you have
a relative path like "BIN" or ".." there, then Paramstr(0) won't contain a
full path, it'll contain a relative path.
So any program that relies on a full path in Paramstr(0) is liable to run
into trouble sometime. Don't do it.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/26 09:47:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-24-92 22:19:00
From Dj Murdoch
To Jud Mccranie
Subject Re: Break & continue
JM> How do you feel about break and continue?
I used to really miss them, since I used them quite a lot in Ratfor. Now
I've had BP 7 for over a month and haven't used either yet.
JM> A minor quibble: they are called procedures rather than reserved words.
JM> However, they fit the syntax of a procedure instead of a reserved word.
This is an advantage: if they had been reserved words, then you wouldn't
be allowed to have variables called Break and Continue, and that might have
messed up some existing programs. Just adding Library to the reserved word
list meant I had to go through several OPro files changing all Library's to
TLibrary's. It's also consistent with the fact that Halt and Exit are procedure
, not reserved words.
JM> Next: they sort of violate the philisophy of Pascal. I use them any way.
I don't see how they violate anything; could you elaborate?
JM> Finally, and most seriously, their use is not robust. That is, they
JM> can be very error prone. You can have a BREAK or CONTINUE working
JM> right, and then insert another loop (say for input validation) and
JM> invalidate the program. That is all to easy to do.
I know the problem, but I don't think they're any less robust than the alternati
e of flag variables, and they're considerably more robust than the GOTO alternat
ve.
JM> In that sense,
JM> they are worse than GOTO, since with GOTO you always know where you're
JM> going to.
The trouble is, you don't. Say you have two loops in a procedure, and you
always use Break as the label to jump to when you get out of a loop. You
might then use Break1 and Break2, but what if you make a typo and jump to
the wrong one? The compiler won't complain a bit.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/26 09:47:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-25-92 08:18:00
From Dj Murdoch
To Steve Connet
Subject Re: Pointers
SC> Should I use NEW & DISPOSE or GETMEM & FREEMEM?
SC> From what I understand, GetMem & FreeMem only allows a maximum of 64k to
SC> be allocated. Is there a limit to New & Dispose?
SC> My Record is 97 bytes long. Within the 64k barrier, a simple
SC> calculation will tell me that I would only be able to read in 675
SC> Records from disk with GetMem & FreeMem.
No, I think you've misunderstood the book. GetMem and New are really the
same procedure; the only difference is that New gets the size from the type
of the thing you're allocating. There's a limit of 64K *per allocation*,
but no limit on total allocations other than the size of your heap. (In fact,
yesterday I allocated 16 Megabytes of variables in a test of the protected
mode of BP 7!).
SC> How about New & Dispose? If my disk file contained 2500 records at 97
SC> bytes each, a simple calculation will tell me that I need 237K of memory
SC> to hold those in memory. Do you use New & Dispose in conjunction with
SC> the functions MemAvail and MaxAvail to monitor memory?
Yes, it's a very good idea to check MaxAvail before doing an allocation.
If you don't, it may fail and abort your program. (You can change this default
behaviour and have it return Nil, but it's better to keep your program simple
for now, because working with a Nil pointer is likely to cause more trouble
than just an abort.)
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/26 09:47:53
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-25-92 08:24:00
From Dj Murdoch
To Scott Samet
Subject Re: ..
SS> I've seen one out there. It did what you mentioned, plus
SS> changed all indentifiers to strings of I, 1, O and 0. Be
SS> sure to keep a large bottle of extra strength Excedrin
SS> when you try to figure out stuff like:
SS> For I011O1I111 := I11O1I00O to O01I1011
SS> I'll see if I can find this beauty and send you a copy.
Yes, please do!! I hope it's something that can be freely distributed.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/26 09:47:53
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 12-25-92 08:43:00
From Dj Murdoch
To Peter Davies
Subject Re: move()
PD> I've been playing around with DOS protected mode in BP7
PD> and have a memory block larger than 64k allocated. The
PD> problem is I need to MOVE data across the 64k boundaries.
PD> That is, say i might say move at 63k for a length of 5k.
PD> What actually happens is that move() wraps around, and
PD> does not perform as I originally expected. Does anyone
PD> have a fix for this, or could anyone write one?
I don't have a fix, but here's the idea of one:
1. Given the start pointer and size to move, figure out how to break up the
source so that no part crosses a 64K boundary. Then you'll have blocks of
64K or less to move, always originating in a single segment.
2. To move one of those blocks, look at the size and the destination. If
it crosses a 64K boundary, it'll need to be moved in two parts.
You'll have to do a lot of fooling around with SelectorInc to get the addressing
right. See the manual (the Language Guide, I think) for the details on that.
It's not going to be trivial, but should be doable. However, I think it would
probably be simpler not to bother with the huge blocks; just do things the
way you would in real mode, with arrays of pointers to blocks. You're already
doing that in effect, with all the work involved in 1 and 2 above.
--- Msg V3.2
* Origin: Murdoch's_Point - - (1:249/99.5)
* Tossed by SFToss/286 v1.02a on 92/12/26 09:47:53